<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="es" xml:lang="es" >
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   <title>{$fsc->page->title} &lsaquo; {$fsc->empresa->nombre}</title>
   <meta name="description" content="FacturaScripts es un software de facturación y contabilidad para pymes. Es software libre bajo licencia GNU/AGPL." />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <link rel="shortcut icon" href="view/img/favicon.ico" />
   <link rel="stylesheet" href="view/css/bootstrap-yeti.min.css" />
   <link rel="stylesheet" href="view/css/datepicker.css" />
   <link rel="stylesheet" href="view/css/custom.css" />
   <script type="text/javascript" src="view/js/jquery-2.1.1.min.js"></script>
   <script type="text/javascript" src="view/js/bootstrap.min.js"></script>
   <script type="text/javascript" src="view/js/bootstrap-datepicker.js" charset="UTF-8"></script>
   <script type="text/javascript" src="view/js/jquery.autocomplete.min.js"></script>
   <script type="text/javascript" src="view/js/base.js"></script>
   <script type="text/javascript">
      function show_precio(precio)
      {
         {if condition="FS_POS_DIVISA=='right'"}
         return number_format(precio, {#FS_NF0#}, '{#FS_NF1#}', '{#FS_NF2#}')+' {$fsc->simbolo_divisa()}';
         {else}
         return '{$fsc->simbolo_divisa()}'+number_format(precio, {#FS_NF0#}, '{#FS_NF1#}', '{#FS_NF2#}');
         {/if}
      }
      function show_numero(numero)
      {
         return number_format(numero, {#FS_NF0#}, '{#FS_NF1#}', '{#FS_NF2#}');
      }
   </script>
  <link rel="stylesheet" href="{$fsc->urlplugin}chosen.css">
  <style type="text/css" media="all">
    /* fix rtl for demo */
    .chosen-rtl .chosen-drop { left: -9000px; }
  </style>
   {loop="$fsc->head_extensions"}{$value->text}{/loop}
</head>
<body>
   <nav class="navbar navbar-default" role="navigation" style="margin: 0px 0px 5px 0px;">
      <div class="container-fluid">
         <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
               <span class="sr-only">Toggle navigation</span>
               <span class="icon-bar"></span>
               <span class="icon-bar"></span>
               <span class="icon-bar"></span>
            </button>
            {if condition="FS_DEMO"}
            <a class="navbar-brand" href="index.php">DEMO</a>
            {elseif condition="$fsc->empresa->nombrecorto"}
            <a class="navbar-brand" href="index.php">{$fsc->empresa->nombrecorto}</a>
            {else}
            <a class="navbar-brand" href="index.php">{$fsc->empresa->nombre}</a>
            {/if}
         </div>
         
         <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
               {loop="$fsc->folders()"}
               <li class="dropdown{if condition="$value==$fsc->page->folder"} active{/if}">
                  <a href="#" class="dropdown-toggle" data-toggle="dropdown" style="text-transform: capitalize;">{$value}</a>
                  <ul class="dropdown-menu">
                     {loop="$fsc->pages($value)"}
                     <li{if condition="$value->showing()"} class="active"{/if}><a href="{$value->url()}">{$value->title}</a></li>
                     {/loop}
                  </ul>
               </li>
               {/loop}
            </ul>
            
            <ul class="nav navbar-nav navbar-right">
               {if condition="$fsc->get_last_changes()"}
               <li class="dropdown">
                  <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                     <span class="glyphicon glyphicon-time hidden-xs"></span>
                     <span class="visible-xs">Historial</span>
                  </a>
                  <ul class="dropdown-menu">
                     {loop="$fsc->get_last_changes()"}
                        <li title="{if condition="$value['nuevo']"}creado{else}modificado{/if} el {$value['cambio']}">
                           <a href="{$value['url']}">
                              {if condition="$value['nuevo']"}
                              <span class="glyphicon glyphicon-file"></span> &nbsp;
                              {else}
                              <span class="glyphicon glyphicon-edit"></span> &nbsp;
                              {/if}
                              {$value['texto']}
                           </a>
                        </li>
                     {/loop}
                  </ul>
               </li>
               {/if}
               
               <li>
                  <a href="#" class="dropdown-toggle" data-toggle="dropdown" title="Ayuda">
                     <span class="glyphicon glyphicon-question-sign hidden-xs"></span>
                     <span class="visible-xs">Ayuda</span>
                  </a>
                  <ul class="dropdown-menu">
                     <li><a href="{#FS_COMMUNITY_URL#}/questions.php" target="_blank">Preguntas</a></li>
                     <li><a href="{#FS_COMMUNITY_URL#}/errors.php" target="_blank">Errores</a></li>
                     <li><a href="{#FS_COMMUNITY_URL#}/ideas.php" target="_blank">Sugerencias</a></li>
                     <li><a href="{#FS_COMMUNITY_URL#}/all.php" target="_blank">Todo</a></li>
                     <li class="divider"></li>
                     <li><a href="#" id="b_feedback">Informar...</a></li>
                  </ul>
               </li>
               
               <li class="dropdown">
                  <a href="#" class="dropdown-toggle" data-toggle="dropdown" title="{$fsc->user->nick}">
                     <span class="glyphicon glyphicon-user hidden-xs"></span>
                     <span class="visible-xs">Usuario</span>
                  </a>
                  <ul class="dropdown-menu">
                     <li><a href="{$fsc->user->url()}">Usuario: {$fsc->user->nick}</a></li>
                     {if condition="$fsc->user->codagente"}
                     <li><a href="{$fsc->user->get_agente_url()}">Empleado: {$fsc->user->codagente}</a></li>
                     {/if}
                     {if condition="count($fsc->user->all())>1 AND !FS_DEMO"}
                        <li class="divider"></li>
                        {loop name="$fsc->user->all()"}
                           {if condition="$value->nick != $fsc->user->nick"}
                           <li><a href="index.php?logout=TRUE&amp;nlogin={$value->nick}">{$value->nick}</a></li>
                           {/if}
                        {/loop}
                     {/if}
                     <li class="divider"></li>
                     <li>
                        <a href="{$fsc->url()}&logout=TRUE">
                           <span class="glyphicon glyphicon-log-out"></span> &nbsp;
                           Cerrar sesión
                        </a>
                     </li>
                  </ul>
               </li>
            </ul>
         </div>
      </div>
   </nav>
   
   {if condition="$fsc->get_errors()"}
   <div class="alert alert-danger hidden-print">
      <ul>{loop="$fsc->get_errors()"}<li>{$value}</li>{/loop}</ul>
   </div>
   {/if}
   {if condition="$fsc->get_messages()"}
   <div class="alert alert-success hidden-print">
      <ul>{loop="$fsc->get_messages()"}<li>{$value}</li>{/loop}</ul>
   </div>
   {/if}
   {if condition="$fsc->get_advices()"}
   <div class="alert alert-info hidden-print">
      <ul>{loop="$fsc->get_advices()"}<li>{$value}</li>{/loop}</ul>
   </div>
   {/if}
   
   {if condition="$fsc->show_fs_toolbar"}
   <div class="container-fluid" style="margin: 10px 0px 10px 0px;">
      <div class="row">
         <div class="{if condition="$fsc->custom_search"}col-lg-10 col-md-10 col-sm-10 col-xs-12{else}col-lg-12{/if}">
            <div class="btn-toolbar" role="toolbar">
               <div class="btn-group hidden-xs">
                  <a class="btn btn-sm btn-default" href="{$fsc->url()}" title="recargar la página">
                     <span class="glyphicon glyphicon-refresh"></span>
                  </a>
                  {if condition="$fsc->page->show_on_menu"}
                     {if condition="$fsc->page->is_default()"}
                     <a class="btn btn-sm btn-default active" href="{$fsc->url()}&amp;default_page=FALSE" title="desmarcar como página de inicio">
                        <span class="glyphicon glyphicon-home"></span>
                     </a>
                     {else}
                     <a class="btn btn-sm btn-default" href="{$fsc->url()}&amp;default_page=TRUE" title="marcar como página de inicio">
                        <span class="glyphicon glyphicon-home"></span>
                     </a>
                     {/if}
                  {/if}
               </div>
               
               <div class="btn-group hidden-xs">
                  {if condition="$fsc->ppage"}
                  <a class="btn btn-sm btn-default" href="{$fsc->ppage->url()}">
                     <span class="glyphicon glyphicon-arrow-left"></span>
                     {$fsc->ppage->title}
                  </a>
                  {/if}
                  <a class="btn btn-sm btn-default active" href="{$fsc->url()}" title="recargar la página">
                     {$fsc->page->title}
                  </a>
               </div>
               
               <div class="btn-group">
                  {loop="$fsc->buttons"}
                     {if condition="stripos($value->value, 'nuev')!==FALSE"}
                     <a id="{$value->id}" class="btn btn-sm btn-success" href="{$value->href}">
                        {$value->value}
                     </a>
                     {elseif condition="get_class($value)=='fs_button_img'"}
                     <a id="{$value->id}" class="btn btn-sm{if condition="$value->remove"} btn-danger{else} btn-default{/if}" href="{$value->href}">
                        {$value->value}
                     </a>
                     {else}
                     <a id="{$value->id}" class="btn btn-sm btn-default" href="{$value->href}">
                        {$value->value}
                     </a>
                     {/if}
                  {/loop}
               </div>
            </div>
         </div>
         {if condition="$fsc->custom_search"}
         <div class="col-lg-2 col-md-2 col-sm-2 col-xs-12">
            <form name="f_custom_search" action="{$fsc->url()}" method="post" class="form">
               <div class="input-group">
                  <input class="form-control" type="text" name="query" value="{$fsc->query}" autocomplete="off" placeholder="Buscar">
                  <span class="input-group-btn hidden-sm">
                     <button class="btn btn-primary" type="submit">
                        <span class="glyphicon glyphicon-search"></span>
                     </button>
                  </span>
               </div>
            </form>
         </div>
         {/if}
      </div>
   </div>
   {/if}
   
   {include="feedback"}
